* dispextern.h (struct face): New field - `copy', to help us with
authorJim Blandy <jimb@redhat.com>
Tue, 25 May 1993 14:01:54 +0000 (14:01 +0000)
committerJim Blandy <jimb@redhat.com>
Tue, 25 May 1993 14:01:54 +0000 (14:01 +0000)
resource allocation.
* xfaces.c (free_frame_faces): Do free the first two faces; don't
free anything from a face that's a copy.
(intern_frame_face): Mark every face we intern as a copy; its
resources are actually a combination of the real faces.
(Fset_face_attribute_internal): No need to check if we're trying
to free one of the frame's GC's; they never enter into the
picture.

src/dispextern.h

index d793abe9cd4a8dcaefb6e44b39535cdb4a336de3..dfdae70b3d050cc5fbae7d70427c2352ed93ed11 100644 (file)
@@ -54,6 +54,15 @@ struct face
   
     /* Whether or not to underline text in this face.  */
     char underline;
+
+    /* Does this face own its resources?  (color, font, etcetera)
+       If this is a face which we computed by combining other faces,
+       then this is true, and we shouldn't free any of the resources
+       it refers to; the faces from which it was constructed own it.
+       On the other hand, if this is a face the user created and
+       filled in directly, then this is false, and we should free the
+       resources when we free it.  */
+    char copy;
   };
 
 /* Let's stop using this and get rid of it.  */